package IT.DataAccess;
import java.sql.CallableStatement;
import java.sql.Connection;
//import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class BDUtil {
    
    private BDConexion oBase;
    
    private Connection oConexion;
    private CallableStatement oCst;    
    //private ResultSet oRst;    
    
    public int getIgv() {
        int nIgv=0;
        
        try {
            oBase = new BDConexion();
            oConexion = oBase.getDataSource().getConnection();
            oBase = null;
            oCst = oConexion.prepareCall("{call usp_VariableIgv(?)}"); 
            oCst.registerOutParameter(1,  java.sql.Types.INTEGER);
            oCst.executeQuery();      
            nIgv=oCst.getInt(1);
           
            oCst.close();
            oConexion.close();
        } catch (SQLException ex) {
            Logger.getLogger(DatArea.class.getName()).log(Level.SEVERE, null, ex);
        }      
        return nIgv;
    }
}
